/***************************************************************************
 * 
 * Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
 * $Id$ 
 * 
 **************************************************************************/

/**
 * @file object_pool.cpp
 * @author liutongren(liutongren@baidu.com)
 * @date 2015/08/08 14:34:25
 * @version $Revision$ 
 * @brief 
 *  
 **/
#include "object_pool.h"
#include <list>
using std::list;
namespace util {
    
    template <typename T> 
        ObjectPool<T>::ObjectPool(void) {
           //this->ObjectPool(0); 
        }


    template <typename T> 
        ObjectPool<T>::ObjectPool(size_t number) {
            //_object_list = new std::list<T*>; 
            //for (int i = 0; i != number; ++i) {
                //T t;
                //_object_list->push_back(t);
            //}
        }

    template <typename T>    
        ObjectPool<T>::~ObjectPool(){
            //if (_object_list != NULL) {
                //iterator_T_ptr it;
                //for (it = _object_list.begin(); it != _object_list.end(); ++it) {
                    //T* ptr_t = *it;                    
                    //delete ptr_t;
                    //ptr_t = NULL;
                //} 
                //delete _object_list;
                //_object_list = NULL;
            //}

        }

    template <typename T>
        T* ObjectPool<T>::get_ptr() {
            //if (_object_list->empty()) {
                //return new T; 
            //} else {
                //T *t = _object_list->front();
                //_object_list->pop_front();
                //return t;
            //}
        }
    
    template <typename T>
        bool ObjectPool<T>::give_back(T *object_ptr) {
            //if (object_ptr == NULL) {
                //return false;
            //} 
            //_object_list->push_back(object_ptr); 
            //return true;
        }
}


/* vim: set ts=4 sw=4 sts=4 tw=100 */
